package com.itheima.dao;

import com.itheima.pojo.Student;
import com.itheima.utils.XmlParserUtils;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: Bytezero_zhengLei
 * @Date: 2024/6/24 21:15
 * @Project_Name:
 * @Email: 420498246@qq.com
 * @Description:
 * @TODO:
 */

@Repository
@Primary
public class StuDao implements StuDaoImpl {

    public List<Student> getStuData() {
        String file = this.getClass().getClassLoader().getResource("stu.xml").getFile();
        List<Student> studentList = XmlParserUtils.parse(file, Student.class);
        return studentList;
    }
}
